-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reverseproxy: Add ID field for upstreams #4350
Conversation
de58ffe
to
5968ebd
Compare
I made a second commit with a proposed way to specify IDs in the Caddyfile, by using |
Ok, so I appreciate the thought going into this. I think I want to see about coming up with a different fix though that doesn't require the user to name the upstream separate from the upstream's... well, its name (address, like DNS name or IP). I will try to give it some brain cycles this week. |
(With all due respect) I will be sunsetting this PR in favor of #4470 which will properly distinguish health check state from upstreams, so IDs will not be needed. (We can reopen if that's not the case for some reason, but I'm pretty sure this will be superseded by that.) Thank you for working on it. 🙏 |
@mholt I don't see how #4470 will distinguish the upstreams from two different |
I'm not finished yet. When I am, the hosts in the pool will not be storing their health state. The crux of the problem will be fixed. Edit: Done now. |
First step for #4341, Caddyfile support would be needed to complete it. /cc @ulrichSchreiner
This makes it possible to specify upstreams in JSON with an
"id"
field, to disambiguate upstreams with the same dial address:Given the JSON config from https://caddy.community/t/healthcheck-not-working-with-multiple-servers/13563, with just
"id"
fields added, we see that it works, the internal state has separate upstreams:To avoid it being a breaking change, I left in the
"address"
field in the admin API, deprecated for now, to be removed at a later date. It's more accurate to call it "ID" even though it could be an ID, a dial address, or a SRV address, depending on how it was configured (i.e. whatever the upstream'sString()
function returns).